package com.lehe.service.impl;

import com.lehe.common.utils.StringUtil;
import com.lehe.dao.AdminGameReportDao;
import com.lehe.entry.GameKindDayOnlineDto;
import com.lehe.entry.UserRoomCardResumeDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 类的相关描述
 *
 * @author 王丹
 * @since 2018-01-29
 */
@Service
@Transactional
public class AdminGameReportService extends AbstractService {

    @Autowired
    AdminGameReportDao adminGameReportDao;

    public List<GameKindDayOnlineDto> queryGameKindDayOnline(String viewDate){
        List<GameKindDayOnlineDto> ret = new ArrayList<>();
        Map<String, Object> params = new HashMap<>();
        params.put("viewDate", viewDate);
        //params.put("v_cursor", ret);
        ret = adminGameReportDao.queryGameKindDayOnline(params);
        Object obj = params.get("v_cursor");
        if(null!=obj){
            ret = (List<GameKindDayOnlineDto>)obj;
        }
        /*GameKindDayOnlineDto dto = new GameKindDayOnlineDto();
        dto.setRpDate("2017-02-03");
        dto.setTjb(200L);
        dto.setCtb(243L);
        dto.setCtbuser(20044L);
        dto.setTjbuser(22243L);
        ret.add(dto);*/
        return ret;
    }

    public List<UserRoomCardResumeDto> queryUserRoomCardResume(String viewDate, Long adminUserId){
        List<UserRoomCardResumeDto> ret = new ArrayList<>();
        Map<String, Object> params = new HashMap<>();
        params.put("viewDate", viewDate);
        params.put("adminUserId", adminUserId);
        //params.put("v_cursor", ret);
        ret = adminGameReportDao.queryUserRoomCardResume(params);
        Object obj = params.get("v_cursor");
        if(null!=obj){
            ret = (List<UserRoomCardResumeDto>)obj;
        }
        /*UserRoomCardResumeDto dto = new UserRoomCardResumeDto();
        dto.setRanking(1111L);
        dto.setViewDate("2018-01-29");
        dto.setUserID(12345L);
        dto.setNickName("测试一下咯");
        dto.setDwellingPlace("长沙");
        dto.setRoomCardResume(789L);
        dto.setScore(43290L);
        dto.setRoomCards(89890L);
        dto.setRoomCount(34243L);
        ret.add(dto);*/
        return ret;
    }
}
